home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
iamstrng.lha
/
iamstring
/
rcString.h
< prev
next >
Wrap
Text File
|
1993-08-08
|
2KB
|
79 lines
*
* rcString.h - class definition for reference counted string
* manipulations.
*
* Copyright (C) 1992, Christoph Streit (streit@iam.unibe.ch)
* Igor Metz (metz@iam.unibe.ch)
* All rights reserved.
*
* This software may be freely copied, modified, and redistributed
* provided that this copyright notice is preserved on all copies.
*
* You may not distribute this software, in whole or in part, as part of
* any commercial product without the express consent of the authors.
*
* There is no warranty or other guarantee of fitness of this software
* for any purpose. It is provided solely "as is".
*
*/
ifndef _rcString_H
define _rcString_H
include <string.h>
/___________________________________________________________ rcString
/ rcString - a reference counted String class
ypedef char* _Char_p_;
lass rcStringRep;
lass ostream;
lass rcString
ublic:
rcString();
rcString(char);
rcString(const char*);
rcString(const rcString&);
~rcString();
char& operator[](unsigned);
char operator[](unsigned) const;
rcString operator()(unsigned, unsigned); // returns a substring
const rcString& operator=(char);
const rcString& operator=(const char*);
const rcString& operator=(const rcString&);
int operator==(const rcString&) const;
int operator==(const char*) const;
int operator!=(const rcString&) const;
int operator!=(const char*) const;
int operator< (const rcString&) const;
int operator<=(const rcString&) const;
int operator> (const rcString&) const;
int operator>=(const rcString&) const;
const char* chars() const;
operator const char*() const;
unsigned length() const;
int empty() const;
friend rcString operator+(const rcString&, const char*);
friend rcString operator+(const char*, const rcString&);
friend rcString operator+(const rcString&, const rcString&);
friend ostream& operator<<(ostream&, const rcString&);
rivate:
rcString(_Char_p_ *r);
rivate:
rcStringRep *rep;
;
endif // rcString_H